<script type="text/javascript" src="<?=surl::get('my')?>area.js.php"></script>
<div class="SubMainTitle"> <b class="FT14">个人资料设置 </b> </div>
<br />
<br />
<form id="setUserInfo" name="setUserInfo" method="post" onsubmit="return XypForm(this)" action="act.php">
<div class="Mylist">
  <table width="90%" border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td width="15%" class="b">帐号：</td>
      <td width="85%"><input name="urs" value="<?=urs?>" type="text" disabled="disabled" size="20"/>
        *</td>
    </tr>
    <tr>
      <td class="b">真实姓名：</td>
      <td><input name="real_name" value="<?=$rs["real_name"]?>" require="1" type="text" size="10" />
        *</td>
    </tr>
    <tr>
      <td class="b">Email：</td>
      <td><input name="email" value="<?=$rs["email"]?>" dataType="email" require="1" type="text" size="30" />
        *</td>
    </tr>
    <tr>
      <td class="b">性别：</td>
      <td><input type="radio" <?=($rs["sex"]==0?'checked="checked"':'')?> name="sex" id="sex" value="0" />女  
         <input type="radio" <?=($rs["sex"]==1?'checked="checked"':'')?> name="sex" id="sex" value="1" />男
        *</td>
    </tr>
    <tr>
      <td class="b">生日：</td>
      <td><input require="1" name="birthday_yy" type="text" value="<?=$rs["birthday_yy"]?>" size="4" maxlength="4"  />
        年
        <select  require="1" name="birthday_mm">
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
          <option value="6">6</option>
          <option value="7">7</option>
          <option value="8">8</option>
          <option value="9">9</option>
          <option value="10">10</option>
          <option value="11">11</option>
          <option value="12">12</option>
        </select>
        <? if($rs["sex"]){?>
        <script type="text/javascript">
			document.setUserInfo.birthday_mm.value = '<?=$rs["birthday_mm"]?>';
		</script>
        <? }?>
        月
        <select  require="1" name="birthday_dd">
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
          <option value="6">6</option>
          <option value="7">7</option>
          <option value="8">8</option>
          <option value="9">9</option>
          <option value="10">10</option>
          <option value="11">11</option>
          <option value="12">12</option>
          <option value="13">13</option>
          <option value="14">14</option>
          <option value="15">15</option>
          <option value="16">16</option>
          <option value="17">17</option>
          <option value="18">18</option>
          <option value="19">19</option>
          <option value="20">20</option>
          <option value="21">21</option>
          <option value="22">22</option>
          <option value="23">23</option>
          <option value="24">24</option>
          <option value="25">25</option>
          <option value="26">26</option>
          <option value="27">27</option>
          <option value="28">28</option>
          <option value="29">29</option>
          <option value="30">30</option>
          <option value="31">31</option>
        </select>
        <? if($rs["sex"]){?>
        <script type="text/javascript">
			document.setUserInfo.birthday_dd.value = '<?=$rs["birthday_dd"]?>';
		</script>
        <? }?>
        日*</td>
    </tr>
    <tr>
      <td class="b">国家地区：</td>
      <td><input  require="1" value="<?=$rs["country"]?>" name="country" type="text" />
        *</td>
    </tr>
    <tr>
      <td class="b">省/市：</td>
      <td>
      <input type="radio" require="1" onclick="From_tw(0)" name="address_province_tw" <?=($rs["address_province_tw"]==0?'checked="checked"':'')?> id="radio" value="0" />其它 
      <input name="address_province_o" require="1" value="<?=$rs["address_province_o"]?>" type="text" id="address_province_o" size="6" />省&nbsp;&nbsp;
      <input name="address_city_o" 	   require="1" value="<?=$rs["address_city_o"]?>" type="text" id="address_city_o" size="10" />市&nbsp;&nbsp;
      <input name="address_borough_o"  require="1" value="<?=$rs["address_borough_o"]?>" type="text" id="address_borough_o" size="10" />镇/区 &nbsp;&nbsp;
      <br />
      <input type="radio" onclick="From_tw(1)" name="address_province_tw" <?=($rs["address_province_tw"]==1?'checked="checked"':'')?> id="radio" value="1" />台湾 
      <input  require="1" value="台湾" name="address_province" type="text" id="address_province" size="6" />省&nbsp;&nbsp;
        <select name="address_city"    onchange="changeSort_upload('setUserInfo',this)"></select>市&nbsp;&nbsp;
        <select name="address_borough" onchange="changeSort_upload('setUserInfo',this)"></select>镇/区 *
        <script type="text/javascript">
			
			var From_tw = function(tw)
			{
				var From = document.forms["setUserInfo"];
				if(tw)
				{
					From.address_province_o.disabled = true;
					From.address_city_o.disabled = true;
					From.address_borough_o.disabled = true;
					From.address_province_o.removeAttribute('require');
					From.address_city_o.removeAttribute('require');
					From.address_borough_o.removeAttribute('require');
					From.address_province_o.style.backgroundColor='lightgrey';
					From.address_city_o.style.backgroundColor='lightgrey';
					From.address_borough_o.style.backgroundColor='lightgrey';
					
					From.address_province.disabled = false;
					From.address_city.disabled = false;
					From.address_borough.disabled = false;
					From.address_province.setAttribute('require',"1");
					From.address_city.setAttribute('require',"1");
					From.address_borough.setAttribute('require',"1");
					From.address_province.style.backgroundColor='#FFFFFF';
					From.address_city.style.backgroundColor='#FFFFFF';
					From.address_borough.style.backgroundColor='#FFFFFF';
				}else
				{
					From.address_province_o.disabled = false;
					From.address_city_o.disabled = false;
					From.address_borough_o.disabled = false;
					From.address_province_o.setAttribute('require',"1");
					From.address_city_o.setAttribute('require',"1");
					From.address_borough_o.setAttribute('require',"1");
					From.address_province_o.style.backgroundColor='#FFFFFF';
					From.address_city_o.style.backgroundColor='#FFFFFF';
					From.address_borough_o.style.backgroundColor='#FFFFFF';
					
					From.address_province.disabled = true;
					From.address_city.disabled = true;
					From.address_borough.disabled = true;
					From.address_province.removeAttribute('require');
					From.address_city.removeAttribute('require');
					From.address_borough.removeAttribute('require');
					From.address_province.style.backgroundColor='lightgrey';
					From.address_city.style.backgroundColor='lightgrey';
					From.address_borough.style.backgroundColor='lightgrey';
				}
			}
			var catCats =<?=json::encode(array("address_city"=>$rs["address_city"],"address_borough"=>$rs["address_borough"]));?>;
			var catSel=["address_city","address_borough"];
			var arrData=[];
			var cats=areas;
			function Init_upload(formName)
			{
				var form = document.forms[formName],k,d,t;
				var t = arrData[0]=cats;
				var CurSelect= form.elements[catSel[0]];
				for(k in cats)
				{
					d = cats[k][0];
					//alert(d);
					SelectOption = new Option(d[0],d[1]);
					CurSelect.options[CurSelect.options.length] = SelectOption;
				}
				//bind
				//$("select",form).bind("change",function(){changeSort_upload(formName,this)});
				//接收初值
				updateSort_upload(formName,catCats.address_city,catCats.address_borough);
			}
			function updateSort_upload(formName,g_c1id,g_c2id)
			{
				var form = document.forms[formName],CurSelect;
				if(g_c1id)
				{
					CurSelect= form.elements[catSel[0]];
					CurSelect.value = g_c1id;
					changeSort_upload(formName,CurSelect);
					if(g_c2id)
					{
						CurSelect = form.elements[catSel[1]];
						CurSelect.value = g_c2id;
						changeSort_upload(formName,CurSelect);
					}
				}
			}
			function changeSort_upload(formName,selectObj)
			{
				var selectNum = CheckSelectObj(selectObj,formName)+1;
				var form = document.forms[formName],k,d,t;
				var ts = arrData[selectNum]=arrData[selectNum-1][selectObj.value];
				var t = arrData[selectNum]=arrData[selectNum-1][selectObj.value][1];
				var CurSelect= form.elements[catSel[selectNum]];
				//CurSelect.options.length=0;
				for(k in t)
				{
					d = t[k][0];
					SelectOption = new Option(d[0],d[1]);
					CurSelect.options[CurSelect.options.length] = SelectOption;
				}
			}
			function CheckSelectObj(selectObj,formName)
			{
				var selectNum = -1;
				var name = selectObj.name;
				for (var i = 0; i < catSel.length; i++) 
				{
					if (catSel[i] == name) 
					{
						selectNum = i;
						break;
					}
				}
				for(i=catSel.length-1;i>selectNum;i--)
				{
					obj=document.forms[formName][catSel[i]];
					obj.options.length = 0; 
				}
				return selectNum ;
			}
			var tw   = <?=(int)$rs["address_province_tw"]?>;
			From_tw(tw);
			Init_upload('setUserInfo');
		</script>
        </td>
    </tr>
    <tr>
      <td class="b">详细地址：</td>
      <td><input require="1" value="<?=$rs["address"]?>"  name="address" type="text" size="40" />
      (不用写<span class="b">地区,省/市,镇/区</span>)
        *</td>
    </tr>
    <tr>
      <td class="b">邮编：</td>
      <td><input require="1" value="<?=$rs["zip"]?>"  name="zip" type="text" size="6" />
        *</td>
    </tr>
    <tr>
      <td class="b">手机：</td>
      <td><input require="1" value="<?=$rs["mobile"]?>"  name="mobile" type="text" size="15" />
        *</td>
    </tr>
    <tr>
      <td class="b">电话：</td>
      <td><input require="1" value="<?=$rs["zone_country"]?>"  name="zone_country" type="text" size="4" maxlength="4" />
        -
        <input require="1" value="<?=$rs["zone_letter"]?>"  name="zone_letter" type="text" size="4" maxlength="4" />
        -
        <input require="1" value="<?=$rs["tel"]?>"  name="tel" type="text" size="12" />
        -
        <input value="<?=$rs["tel_ext"]?>"  name="tel_ext" type="text" size="4" maxlength="4" id="tel_ext" />
        * 固定电话(国际区号-区号-电话号码-分机) </td>
    </tr>
    <tr>
      <td class="b">其他联系电话：</td>
      <td><input require="1" value="<?=$rs["tel2"]?>" name="tel2" type="text" size="12" /></td>
    </tr>
    <tr>
      <td class="b">将固定电话：</td>
      <td><input name="mostly_tel" <?=($rs["mostly_tel"]=="mobile"?'checked="checked"':'')?> type="radio" value="mobile" />
        作为交易联系方式
        <input name="mostly_tel"  <?=($rs["mostly_tel"]=="tel"?'checked="checked"':'')?> type="radio" value="tel" />
        不作为交易联系方式 *</td>
    </tr>
    <tr>
      <td colspan="2" class="b">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="submit" class="submitMini" value="我塡好啦，提交出去">
        <input name="Pact" type="hidden" value="setUserInfo" />
        &nbsp;&nbsp;
        <input type="reset" class="submitMini">        </td>
    </tr>
  </table>
</div>
</form>
<script type="text/javascript">
$("input.submitMini").mouseover(function(){this.className='submitMiniOver'}).mouseout(function(){this.className='submitMini'});
document.title = $("b.FT14","div.SubMainTitle").html().trim()+"_"+document.title;

if(typeof XypForm == "undefined")
{
	include.js(__scfg__.staticUrl+"xypfrom/xypfrom.js");
	include.css(__scfg__.staticUrl+"xypfrom/xypfrom.css");
}
</script>
